﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;

namespace Fastyou.Other.Consoles
{
    public delegate void AsyncDelegate(DateTime time);
    class AsyncInvoke
    {
        public AsyncInvoke()
        {
        }

        public void DoAsyncEvent(DateTime time)
        {
            Console.WriteLine(string.Format("DoAsyncEvent,time is {0}.", time.ToString()));
            Thread.Sleep(2000);
            Console.WriteLine(string.Format("DoAsyncEvent,now time is {0}.",DateTime.Now.ToString()));
        }

        public void DoSyncEvent(DateTime time)
        {
            Console.WriteLine(string.Format("DoSyncEvent,time is {0}.", time.ToString()));
            Thread.Sleep(5000);
            Console.WriteLine(string.Format("DoSyncEvent,time is {0}.", DateTime.Now.ToString()));
        }
    }
}
